import React from 'react'
interface ClickFunc {
  (): void
}
interface PropType {
  name: string,
  size?: number,
  color?: string,
  stop?: boolean,
  clickIcon?: ClickFunc
}
function index(props: PropType) {
  return (
    <i 
      className={'iconfont icon-'+props.name}
      onClick = {
        (e) => {
          
          props.clickIcon()
          if (props.stop) {
            e.stopPropagation();
          }
        }
      }
      style={{
        fontSize: props.size,
        color: props.color
      }}
    >
      
    </i>
  )
}
index.defaultProps = {
  size: 16,
  color: '#333',
  clickIcon: () => {

  }
}
export default index
